# -*- coding: utf-8 -*-
import sys

from lily.products import Product
"""
同步lily产品信息
"""
if __name__ == '__main__':
    args = sys.argv
    if len(args) < 2:
        print('Usage cate_id to load product')
        exit(1)
    # 新产品分类
    new_cate_id = int(args[2])

    if new_cate_id < 1:
        print('cate_id not in range')
        exit(1)

    print(f'set product start to load: {new_cate_id}')
    obj = Product(new_cate_id)
    rows = obj.add()
    print(f'set product end to load: {new_cate_id}')


